<div class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 <form action="<?php echo site_url(('user/to_do/save_from_subtask/'))?>" method="POST" onsubmit="return validates()" id="frm">
  <div class="modal-header">
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h3 id="myModalLabel">Schedule your subtask to To-Do</h3>
  </div>
  <div class="modal-body">  
  <?php if($this->ion_auth->is_admin($this->session->userdata('user_id'))) {?>
  <label>For</label>
  <select name="user">
  <?php foreach($users as $user){
  	if(!$this->ion_auth->is_client($user->id) OR !$this->ion_auth->is_active($user->id)){		
	?>
  <option value="<?php echo $user->id;?>"><?php echo $user->username?></option>	
  <?php }}?>
  </select>
  <?php }else{?>
  <input type="hidden" value="<?php echo $this->session->userdata('user_id');?>" name="user"/>
  <?php }?>
	<label>Description</label>
	<input type="hidden" value="<?php echo $subtasks['id']?>" name="subtask_id"/>
	<input type="hidden" value="<?php echo $tasks_id?>" name="tasks_id"/>	
	<textarea class="span5" name="desc" readonly="readonly"><?= $subtasks['desc']?></textarea>	
	<hr />
	<?php 
	$cmonth = date('m');
	?>
	Date: <input  type="text" class="span1" name="date" value="<?php echo date('d')?>" id="date"/>
	<select name="month" class="span2" id="month">       
        <option value="1" <?php if($cmonth == '01'){echo 'selected="selected"';} ?> >January</option>
        <option value="2" <?php if($cmonth == '02'){echo 'selected="selected"';} ?> >February</option>
        <option value="3" <?php if($cmonth == '03'){echo 'selected="selected"';} ?> >March</option>
        <option value="4" <?php if($cmonth == '04'){echo 'selected="selected"';} ?> >April</option>
        <option value="5" <?php if($cmonth == '05'){echo 'selected="selected"';} ?> >May</option>
        <option value="6" <?php if($cmonth == '06'){echo 'selected="selected"';} ?> >June</option>
        <option value="7" <?php if($cmonth == '07'){echo 'selected="selected"';} ?> >July</option>
        <option value="8" <?php if($cmonth == '08'){echo 'selected="selected"';} ?> >August</option>
        <option value="9" <?php if($cmonth == '09'){echo 'selected="selected"';} ?> >September</option>
        <option value="10" <?php if($cmonth == '10'){echo 'selected="selected"';} ?> >October</option>
        <option value="11" <?php if($cmonth == '11'){echo 'selected="selected"';} ?> >November</option>
        <option value="12" <?php if($cmonth == '12'){echo 'selected="selected"';} ?> >December</option>
    </select>
	<select class="span1" name="year">
		<option value="13">2013</option>
	</select>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
    <button class="btn btn-info" type="submit">Save changes</button>  
  </div>
  </form>
</div>